Task queue persist dead letter queue to file and expose /api/tasks/dead letter endpoint#421
Open
clintjeff2 wants to merge 2 commits into
Conversation
Persist task dead-letter queue and add DLQ API endpoints
|
Contributor
Author
|
@leocagli, review and merge. |
Contributor
Author
|
@leocagli, please review and merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Motivation
Description
lib/agent-runtime/task-queue.tsincluding aDeadLetterTaskEntryshape,persistDeadLetterQueue()andloadDeadLetterQueue()helpers, and support for overriding the path viaTASK_DLQ_FILE(default/.data/task-dlq.json).loadDeadLetterQueue(); writes use a temp file +renamefor atomic updates.GET /api/tasks/dead-letterthat returns entries and pagination metadata viaapp/api/tasks/dead-letter/route.ts.POST /api/tasks/dead-letter/[id]/retryto move a DLQ task back to pending andDELETE /api/tasks/dead-letter/[id]to permanently discard an entry viaapp/api/tasks/dead-letter/[id]/retry/route.tsandapp/api/tasks/dead-letter/[id]/route.ts.listDeadLetterEntries()anddiscardDeadLetterTask()helpers and wired persistence calls intofailTask()andretryDeadLetterTask().__tests__/api/tasks.test.tsto set up a tempTASK_DLQ_FILE, verify file persistence/reload, and exercise the new list/retry/delete endpoints.Testing
npm test -- __tests__/api/tasks.test.ts, and they passed (6 tests passed).npm testwhich completed but failed unrelated suites due to a missing dependency (lru-cache) in other parts of the repo; this is unrelated to the DLQ changes.npx tsc --noEmit; these surfaced pre-existing unrelated lint/type errors and missing packages (lru-cache,@wagmi/connectors) but did not indicate issues with the DLQ functionality.Closes #192